package cn.tedu.spring.life;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestUser {

    @Test
    public void lifeTest(){
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("bean-life.xml");
        User user = context.getBean("user", User.class);
        // 使用阶段
        System.out.println("4-使用bean阶段");
        // 销毁bean
        context.close();

    }
}
